<!doctype html>
<html class="no-js" lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <title></title>
    <link href="bootstrap.css" rel="stylesheet">
    <style type="text/css">
        div{
            padding:4px;
        }
        [class*="span12"] {
            border:1px solid #ddd;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row-fluid">
        <div class="row-fluid">
        <div class="span12">
            <div class="span6">
                <b>LPG System</b>
            </div>
            <div class="span6">        
                <b>Gasifier</b>
            </div>
        </div>
        </div>
        
        <div class="row-fluid">
        <div class="span12">
            <div class="span4">
             1.Consumption of LPG
            </div>
            <div class="span2">
                <input class="span2" id="conlpg" onkeyup="myFunction()" value="4" size="1"/> Kgs/Hr
            </div>
        
            <div class="span4">
                2.Wood chips Consumption Chips/Kg of LPG = 5 Kgs         
            </div>
            <div class="span2">
                <input class="span3" id="conchips" onkeyup="myFunction()" value="20" size="1"/> Kgs/Hr
            </div>
        </div>
        </div>
        
        <div class="row-fluid">
        <div class="span12">
            <div class="span6">
                3.Number of hours usage 
                <input class="span2" id="useday" onkeyup="myFunction()" value="8" size="1"/> Hrs /Day
                <br/><br/>
                4.Number of months
                <input class="span2" id="formonth" onkeyup="myFunction()" value="4" size="1"/>
            </div>
        </div>
        </div>
        
        <div class="row-fluid">
        <div class="span12">
            <div class="span4">
                7.LPG consumption per Month( 
                <b id="loutputhr">8</b> Hrs x  
                <b id="loutput">4</b> Kgs x 30 Days )
            </div>
            <div class="span2">
                <b id="loutputtotal">960</b> Kgs/M
            </div>
            <div class="span4">
                8.Wood chips consumption per month
                &nbsp;( 
                <b id="goutputhr">8</b> Hrs x 
                <b id="goutput">20</b> Kgs x 30 Days ) O/p
            </div>
            <div class="span2">
                <b id="goutputtotal">4800</b> Kgs/M
            </div>
        </div>
        </div>
        
        <div class="row-fluid">
        <div class="span12">
            <div class="span4">
                5.Cost of &nbsp;&nbsp;LPG /Kg (Rs.)
            </div>
            <div class="span2">
                <input class="span3" id="lpgcost" onkeyup="myFunction()" value="90" size="1"/>
            </div>
            <div class="span4">
                6.Cost of Wood chips /Kg (Rs.)
            </div>
            <div class="span2">
                <input class="span3" id="gcost" onkeyup="myFunction()" value="6" size="1"/>
            </div>
        </div>
        </div>
        
        <div class="row-fluid">
        <div class="span12">
            <div class="span4">
                9.Monthly cost of LPG  o/p
            </div>
            <div class="span2">
                Rs. <b id="lpgcostmn">86400</b>/M
            </div>
            <div class="span4">
                10.Cost of Wood chips
                 ( 4800 Kgs x 6 Rs. )
            </div>
            <div class="span2">
                Rs.<b id="gcostmn">28800</b>/M
            </div>
        </div>
        </div>
        
        <div class="row-fluid">
        <div class="span12">
                11.Gross Savings by Gasifier, Rs.<b id="gross">57,000</b>/- 
        </div>
        </div>
    </div>
</div>
<script type="text/javascript">
function myFunction()
{

var input_lpg = document.getElementById('conlpg');
var input_chips = document.getElementById('conchips');
var useday = document.getElementById('useday');
var lpgcost = document.getElementById('lpgcost');
var gcost = document.getElementById('gcost');

input_lpg.onkeyup = function() {
document.getElementById('loutput').innerHTML = input_lpg.value;
updateTotalL();
updateLpgtCost();
};
useday.onkeyup = function() {
document.getElementById('loutputhr').innerHTML = useday.value;
document.getElementById('goutputhr').innerHTML = useday.value;
updateTotalL();
updateLpgtCost();
updateTotalG();
updategtCost();
};
formonth.onkeyup = function() {
updateTotalL();
updateTotalG();
updateLpgtCost();
updategtCost();
};


// Gasifier Section
input_chips.onkeyup = function() {
document.getElementById('goutput').innerHTML = input_chips.value;
updateTotalG();
updategtCost();
};

lpgcost.onkeyup = function() {
updateLpgtCost();
};
gcost.onkeyup = function() {
updategtCost();
};
}

function updateLpgtCost() {

var cost = document.getElementById('lpgcost').value;
var input_lpg = document.getElementById('conlpg').value;
var useday = document.getElementById('useday').value;
total = input_lpg * useday * 30;
total2 = cost * total;
document.getElementById('lpgcostmn').innerHTML = total2;
gross();
}

function updategtCost() {

var cost = document.getElementById('gcost').value;
var cinput_lpg = document.getElementById('conchips').value;
var cuseday = document.getElementById('useday').value;
ctotal = cinput_lpg * cuseday * 30;
total2 = cost * ctotal;
document.getElementById('gcostmn').innerHTML = total2;
gross();

}
function updateTotalL() {
var input_lpg = document.getElementById('conlpg').value;
var useday = document.getElementById('useday').value;
total = input_lpg * useday * 30;
document.getElementById('loutput').innerHTML = input_lpg;
document.getElementById('loutputhr').innerHTML = useday;
document.getElementById('loutputtotal').innerHTML = total;

}

function updateTotalG() {
var cinput_lpg = document.getElementById('conchips').value;
var cuseday = document.getElementById('useday').value;
ctotal = cinput_lpg * cuseday * 30;
document.getElementById('goutput').innerHTML = cinput_lpg;
document.getElementById('loutputhr').innerHTML = cuseday;
document.getElementById('goutputtotal').innerHTML = ctotal;

}

function gross() {
var formonth = document.getElementById('formonth').value;
var gcost = document.getElementById('gcostmn').innerHTML;
var lpgcost = document.getElementById('lpgcostmn').innerHTML;
total = (lpgcost - gcost)* formonth;
document.getElementById('gross').innerHTML = total + " for "+ formonth + " month";
}
</script>
</body>
</html>